package org.blame.lotterysystem.service.dto;

import lombok.Data;
import org.blame.lotterysystem.dao.dataObject.UserDO;
import org.blame.lotterysystem.service.enums.ActivityPrizeEnum;
import org.blame.lotterysystem.service.enums.ActivityPrizeTiersEnum;
import org.blame.lotterysystem.service.enums.ActivityStatusEnum;
import org.blame.lotterysystem.service.enums.ActivityUserEnum;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ActivityDetailDTO {

    private Long activityId;

    private String activityName;

    private String description;

    private ActivityStatusEnum status;

    public boolean valid(){
        return status.equals(ActivityStatusEnum.RUNNING);
    }

    private List<PrizeDTO> prizeDTOList;

    private List<UserDTO> userDTOList;

    @Data
    public static class PrizeDTO {
        /**
         * 奖品Id
         */
        private Long prizeId;
        /**
         * 奖品名
         */
        private String name;

        /**
         * 图片索引
         */
        private String imageUrl;

        /**
         * 价格
         */
        private BigDecimal price;

        /**
         * 描述
         */
        private String description;

        /**
         * 奖品等级
         */
        private ActivityPrizeTiersEnum tiers;

        /**
         * 奖品数量
         */
        private Long prizeAmount;

        /**
         * 奖品状态
         */
        private ActivityPrizeEnum status;

        public Boolean valid() {
            return status.equals(ActivityPrizeEnum.INIT);
        }
    }

    @Data
    public static class UserDTO {
        /**
         * 用户id
         */
        private Long userId;
        /**
         * 姓名
         */
        private String userName;
        /**
         * 状态
         */
        private ActivityUserEnum status;

        public Boolean valid() {
            return status.equals(ActivityUserEnum.INIT);
        }
    }

}
